package com.projet.segmiMap.DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created with IntelliJ IDEA.
 * User: fifi
 * Date: 16/11/13
 * Time: 19:28
 * To change this template use File | Settings | File Templates.
 */
public class QueryBd {

    public QueryBd() {
    }

    public Connection connection(){
        Connection cx=null;
        try{
            Class.forName("com.mysql.jdbc.Driver");
            cx= DriverManager.getConnection("jdbc:mysql://localhost:80/segmiMap","root","");
        }catch(ClassNotFoundException e){
            System.out.println("Le driver n'a pas été trouvé");
            e.printStackTrace();
        }
        catch (SQLException e) {
            System.out.println("Erreur lors de la connection à la BDD");
            e.printStackTrace();
        }

        return cx;
    }
}

